package util;

import java.util.Scanner;
public class Demo4 {
    public static void main(String[] args) {
        System.out.println("请输入五个成绩");
        int[] a = new int[5];
        Scanner input = new Scanner(System.in);
        for (int x = 0; x < 5; x++) {
            int b = a[x] = input.nextInt() ;
            while(b<0|b>100){
                System.out.println("成绩有误，不列入计算");
                x--;
                break;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            sum += a[i];
        }
        System.out.println("该成绩之和为："+sum);
    }
}

